#include "mainwindow.h"
#include "logindialog.h"
#include <QDebug>
#include <QApplication>
#include <iostream>
#include <QDesktopWidget>
using namespace std;
int main(int argc, char *argv[])
{
    int result = 0;
   QApplication a(argc, argv);
   QApplication::setQuitOnLastWindowClosed(false); //防止字窗口关闭时主程序被关闭
   MainWindow w;
   w.move((QApplication::desktop()->width()-w.width())/2,(QApplication::desktop()->height()-w.height())/2);
   LoginDialog dlg;
   if(dlg.exec()==QDialog::Accepted)
   {
       w.show();
       result =  a.exec();
   }
   return result;
}
